﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo9
{
    public class OldBook:Product
    {
        public DateTime PublishDate{ get ; set; }

        public override decimal CalDiscount()
        {
            if (PublishDate.Year < DateTime.Now.Year)
                return Price * 0.8m;
            else
                return base.CalDiscount();
        }
    }
}
